package com.Redis.Server;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

import com.Redis.Serviceimpl.ConsumerServicesImpl;


public class InstantiationTracingBeanPostProcessor implements ApplicationListener<ContextRefreshedEvent> {
	private Logger logger = Logger.getLogger(this.getClass().getName());
	
	@Autowired
	private ConsumerServicesImpl consumerServices;
	
	@Override
	public void onApplicationEvent(ContextRefreshedEvent event) {
		// TODO Auto-generated method stub
		//System.out.println("bean 加载完成后 启动！！！！！！！！！！！！！！");
		 logger.info("消费者启动！！！");
//			//启动消费者	
		try {
			consumerServices.consumption();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
